Container based service management

ABSTRACT

A method, computer system, and a computer program product for migrating a service from one container to another container is provided. The present invention may include obtaining a first group of requests that are accessing a service launched in a first container instance and a second group of requests that are waiting for accessing the service. The present invention may also include generating a migrated service in a second container instance by migrating the service from the first container instance to the second container instance based on the obtained first and second groups of requests. The present invention may further include directing the second group of requests to the migrated service in the second container instance.

BACKGROUND

The present disclosure generally relates to provision of computerservice. Specifically, implementations of the present disclosure relateto methods, systems and computer program product for migrating a servicefrom one container to another container.

Modern computing systems are getting increasingly large and complex,such that these systems often provide multiple services and supportconcurrent access by a large number of requests by users. Usually, aservice may be provided in one or more computing devices (physicaldevices and/or virtual devices) and this service may be continuouslyaccessed by requests from various applications. Sometimes, this serviceneeds to be migrated from one computing device to another due to a heavyworkload of the device or another situation. As some requests areaccessing the service and some requests are waiting for accessing theservice, this service cannot be shut down for the migration. Otherwise,if the service is shut down, then the information about all the aboverequests will be lost and cannot be recovered. At this point, how tomigrate an active service to a target computing device and reduce theshut down time of the service becomes a focus in the art.

SUMMARY

In one aspect, a computer-implemented method for migrating a servicefrom one container to another container is disclosed. According to themethod, a first group of requests that are accessing a service launchedin a first container instance and a second group of requests that arewaiting for access the service are obtained. A migrated service in asecond container instance is generated by migrating the service from thefirst container instance to the second container instance based on theobtained first and second groups of requests. The second group ofrequests is directed to the migrated service in the second containerinstance.

In another aspect, a computing system for migrating a service from onecontainer to another container is disclosed. The computing systemcomprises one or more computer processors coupled to one or morecomputer-readable memory units, where the memory unit comprisesinstructions that when executed by the computer processor implements amethod. According to the method, a first group of requests that areaccessing a service launched in a first container instance and a secondgroup of requests that are waiting for access the service are obtained.A migrated service in a second container instance is generated bymigrating the service from the first container instance to the secondcontainer instance based on the obtained first and second groups ofrequests. The second group of requests is directed to the migratedservice in the second container instance.

In another aspect, a computer program product for migrating a servicefrom one container to another container is disclosed. The computerprogram product is one or more computer-readable storage media andprogram instructions stored on at least one of the one or more tangiblestorage media. When the instructions are executed on an electronicdevice, the electronic device is caused to: obtain a first group ofrequests that are accessing a service launched in a first containerinstance and a second group of requests that are waiting for accessingthe service; generate a migrated service in a second container instanceby migrating the service from the first container instance to the secondcontainer instance based on the obtained first and second groups ofrequests; and direct the second group of requests to the migratedservice in the second container instance.

It is to be understood that the Summary is not intended to identify keyor essential features of implementations of the present disclosure, noris it intended to be used to limit the scope of the present disclosure.Other features of the present disclosure will become easilycomprehensible through the description below.

BRIEF DESCRIPTION OF THE DRAWINGS

Through the more detailed description of some implementations of thepresent disclosure in the accompanying drawings, the above and otherobjects, features and advantages of the present disclosure will becomemore apparent, wherein:

FIG. 1 depicts a cloud computing node according to an embodiment of thepresent invention;

FIG. 2 depicts a cloud computing environment according to an embodimentof the present invention;

FIG. 3 depicts abstraction model layers according to an embodiment ofthe present invention;

FIG. 4 depicts a diagram for managing a service launched in a containerinstance according to an approach;

FIG. 5 depicts a diagram for managing a service launched in a containerinstance according to one implementation of the present disclosure;

FIG. 6 depicts a flowchart of a method for managing a service accordingto one implementation of the present disclosure;

FIG. 7 depicts a diagram for migrating a service launched in a firstcontainer instance to a second container instance according to oneimplementation of the present disclosure;

FIG. 8A depicts a diagram for migrating a static portion of a servicelaunched in a first container instance to a second container instanceaccording to one implementation of the present disclosure;

FIG. 8B depicts a diagram for migrating a dynamic portion of a servicelaunched in a first container instance to a second container instanceaccording to one implementation of the present disclosure; and

FIG. 9 depicts a diagram of a container cluster for managing a serviceaccording to one implementation of the present disclosure.

Throughout the drawings, same or similar reference numerals representthe same or similar elements.

DETAILED DESCRIPTION

Some preferable embodiments will be described in more detail withreference to the accompanying drawings, in which the preferableembodiments of the present disclosure have been illustrated. However,the present disclosure can be implemented in various manners, and thusshould not be construed to be limited to the embodiments disclosedherein.

It is to be understood that although this disclosure includes a detaileddescription on cloud computing, implementation of the teachings recitedherein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g., networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure that includes anetwork of interconnected nodes.

Referring now to FIG. 1, a schematic of an example of a cloud computingnode is shown. Cloud computing node 10 is only one example of a suitablecloud computing node and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments of the inventiondescribed herein. Regardless, cloud computing node 10 is capable ofbeing implemented and/or performing any of the functionality set forthhereinabove.

In cloud computing node 10 there is a computer system/server 12 or aportable electronic device such as a communication device, which isoperational with numerous other general purpose or special purposecomputing system environments or configurations. Examples of well-knowncomputing systems, environments, and/or configurations that may besuitable for use with computer system/server 12 include, but are notlimited to, personal computer systems, server computer systems, thinclients, thick clients, hand-held or laptop devices, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputer systems, mainframecomputer systems, and distributed cloud computing environments thatinclude any of the above systems or devices, and the like.

Computer system/server 12 may be described in the general context ofcomputer system-executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

As shown in FIG. 1, computer system/server 12 in cloud computing node 10is shown in the form of a general-purpose computing device. Thecomponents of computer system/server 12 may include, but are not limitedto, one or more processors or processing units 16, a system memory 28,and a bus 18 that couples various system components including systemmemory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnect (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples, include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

Referring now to FIG. 2, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 includes one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 2 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 3, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 2) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 3 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provide cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may include applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provide pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and service processing 96. The serviceprocessing 96 may implement the solution for service management.

For the purpose of description, detailed description will be presentedto various implementations of the present disclosure in the cloudenvironment, where a container cluster may be deployed in the cloudenvironment and provide services to various applications.

In the context of the present disclosures, a service refers to aprocess, launched in a device, for providing an intended result inresponse to receiving a request for example from an application. Forexample, a temperature service may provide the temperature at a locationand a time point as specified in the request. In another example, an airquality service may provide the PM 2.5 value at a location and a timepoint as specified in the request.

A container refers to a device for hosting one or more services. In onesituation, the container may be implemented by a physical computingdevice such as a computer; alternatively, the container may beimplemented by a virtual machine. The container may be provided in thecloud environment. Once the container has been started up and launchedthe services, the container may be referred to as a container instance.

A container cluster refers to a group of container instances. Usually,the container cluster may include one or more common container instancesfor hosting the services and at least one management container instancefor managing the cluster as a leader. The container cluster is thefoundation for the services and it may be implemented in a commoncluster structure or in the cloud environment.

FIG. 4 depicts a diagram 400 for managing a service launched in acontainer instance according to an approach. As depicted in FIG. 4, acontainer cluster 410 may include a container instance 412, where aservice 414 is launched in the container instance 412. A plurality ofapplications such as applications 420, 422, and 424 may connect to thecontainer instance 412 and send requests for accessing the service 414.Although only one container instance 412 is depicted, the containercluster 410 may include more container instances. Further, although onlyone service 414 is depicted in the container instance 412, there may bemore services launched in the container instance 412. In the approach ofFIG. 4, the container instance 412 may be implemented by a computingdevice, the service 414 may be a temperature service, and theapplications 420, 422, and 424 may be weather forecast applicationsinstalled in the user devices such as smart phones or other type ofcomputing device.

Service migration may occur under several situations. In the context ofthe present disclosure, migrating a service refers to moving the datarelated to the service from a source container to a destinationcontainer. During the migration, the related data may be graduallycopied from the source container to the destination container. After theservice has been completed copied to destination container, the relateddata in the source container may be removed.

During the operation of the container cluster 410, there may be arequirement for migrating the service 414 from the container instance412 to another container instance. In one situation, the data center forhosting the container cluster 410 may be updated and old devices in thedata center should be replaced with new ones. At this point, theservices launched in the old devices should be migrated to the newdevices. In another situation, resources in the container instance 412may be exhausted and the applications 420, 422, 424 have to wait a longtime for the query result. Considering the resource shortage in thecontainer instance 412, some of the services launched in the containerinstance 412 should be migrated to another container instance to relievethe resource stress.

Some approaches have been proposed to perform the service migration.However, these approaches cannot achieve on-line service migration andthe to-be-migrated service should be shut down, which introducesinterruption to the on-line services. Specifically, the applications420, 422, and 424 directly connect to the container instance 412, andthe connections between a respective one in the applications and thecontainer instance 412 will be lost during the migration. Further, afterthe service 414 is migrated to another container instance, the migratedservice cannot recover the lost connections and the applications thatlost connections with the service 414 have to resend new requests to themigrated service.

In order to at least partially solve the above and other potentialproblems, a new method and system for service management are disclosedherein. According to implementations of the present disclosure, a methodis disclosed. In the method, a first group of requests that areaccessing a service launched in a first container instance and a secondgroup of requests that are waiting for accessing the service areobtained. A migrated service in a second container instance is generatedby migrating the service from the first container instance to the secondcontainer instance based on the obtained first and second groups ofrequests. The second group of requests is redirected to the migratedservice in the second container instance.

FIG. 5 depicts a diagram 500 for managing a service launched in acontainer instance according to one implementation of the presentdisclosure. As depicted in FIG. 5, a service agent 520 is deployed formanaging the requests from the various applications 420, 422, and 424.The information of these requests (including the first group of requeststhat are accessing the service 522 and the second group of requests thatare waiting for accessing the service 522) may be obtained. Based on theobtained information of the requests, the service 522 may be migratedfrom the container instance 512 to the container instance 514 togenerate a migrated service 524. As the service agent 520 records theinformation of the requests from the applications 420, 422, and 424, therequests that are waiting for accessing the service 522 may be directedto the migrated service 524 after the service migration.

With the above implementation, the service 522 remains active and may beaccessed by the first group of requests during the migration. After themigration, the second group of requests may be directed to the migratedservice 524 without a new request being resent from the application. Atthis point, the shut down time of the service may be reduced and thusthe container cluster 510 may provide the service without interruption.

FIG. 6 depicts a flowchart of a method 600 for managing a serviceaccording to one implementation of the present disclosure. At 610, afirst group of requests that are accessing a service launched in a firstcontainer instance and a second group of requests that are waiting foraccessing the service are obtained. During the operation of the service522, multiple requests may be received at the container instance 512.Depending on the workload of the service 522 and the chronological orderof these received requests, some of the requests may immediately accessthe service 522, and some of the requests have to wait for their turnfor accessing the request.

In one implementation, multiple threads may be initiated in the service522 and provide multiple accessing paths to multiple requests. Forexample, two threads may be initiated in the service 522 and thus thefirst two requests may access the service 522 concurrently. However, theother requests have to wait for accessing the service 522. At thispoint, information of the requests (such as which request(s) isaccessing the service 522 and which request(s) is waiting for accessingthe service 522) may be obtained at 610.

At 620, a migrated service 524 is generated in a second containerinstance 514 by migrating the service 522 from the first containerinstance 512 to the second container instance 514 based on the obtainedfirst and second groups of requests. As the first and second groupsidentify the connection state of the container instance 512 with theapplications 420, 422, and 424, the service 522 launched in thecontainer instance 512 may be migrated based on the first and secondgroups.

Generally, rules for the service migration are: 1) if the service hasalready started to serve a given request and the given request isaccessing the service, then the given request may continue the accessduring the migration; 2) if a given request is waiting for accessing theservice, then the given request may be held for some time during themigration. Based on the above rules, the first group of requests maycontinue accessing the service 522 and the second group of requests maybe held until the migration is complete. Details of the migration willbe described with reference to FIGS. 7, 8A, 8B, and 9 in the followingparagraphs.

At 630, the second group of requests is directed to the migrated servicein the second container instance. After the service 522 is migrated fromthe container instance 512 to the container instance 514, the secondgroup of requests may be directed to and served by the migrated service524. At this point, the second group of requests are recovered from theholding state.

In some implementations of the present disclosure, the method 600depicted in FIG. 6 may be triggered according to various situations. Inone implementation, the method 600 may be triggered in response todetecting a workload associated with the service being above athreshold. At this point, migrating the service to another containerinstance may decrease the workload in the original container instance.In another implementation, the migration may be triggered in response toreceiving a migrating command. Although the present disclosure describesthe above two situations that may trigger the migration, the method 600may be implemented based on another specific requirement.

FIG. 7 depicts a diagram 700 for migrating a service launched in a firstcontainer instance to a second container instance according to oneimplementation of the present disclosure. In FIG. 7, two services 710and 522 are launched in the container instance 512 and theimplementation is described in a situation where the workload associatedwith the service 522 is heavy and the service 522 should be migrated tothe container instance 514.

In some implementations of the present disclosure, a workload of aresource in the first container instance in which the service islaunched may be monitored. In the context of the present disclosure, theresource may refer to various resources that may affect the speed ofaccessing the service by the request. For example, the resource mayinclude the memory resource, the computing resource such as CPU (CentralProcessing Unit) in the container instance, and the like. Referring toFIG. 7, it may be defined that if the usage of the memory/CPU in thecontainer instance 512 reaches a threshold such as 90%, then the relatedservice 522 should be migrated to the container instance 514.

In some implementations of the present disclosure, a workload of aresource occupied by the service in the first container instance may bemonitored. The migration rule may define that if the usage of thememory/CPU occupied by the service 522 reaches a predefined threshold,then the service 522 should be migrated to the container instance 514.

The following paragraphs will describe the details for the servicemigration. In some implementations of the present disclosure, in orderto migrate the service based on the obtained first and second groups ofrequests, the second group of requests may be suspended. It is to beunderstood that only the second group of requests are suspended and thefirst group of requests may continue to access the service. Next, dataassociated with the service may be copied from the first containerinstance to the second container instance without suspending the firstgroup of requests. Referring to FIG. 7, the first and second groups ofrequests are connecting to the container instance 512. In thissituation, the second group of requests may be suspended, and the firstgroup of requests may continue accessing the service 522 during copyingthe service 522 from the container instance 512 to the containerinstance 514 to generate a migrated service 524.

In some implementations of the present disclosure, various types of dataassociated with the service may be copied to the second containerinstance at different time points during the migration. For example,first a static portion of the data may be copied to the second containerinstance, where the static portion stores data that is unchanged whenthe first group of requests are accessing the service. Then, after thefirst group of requests have completed accessing the service, a dynamicportion of the data may be copied to the second container instance,where the dynamic portion stores data that is changed when the firstgroup of requests are accessing the service. Reference will be made toFIGS. 8A and 8B for the detailed copy procedure.

In the context of the present disclosure, the static portion may referto the static resources that are unchanged during the running of theservice. The static resource may include codes and data that areassociated with the service. Here, the codes may include program codessuch as the application binary of the service. The data that isassociated with the service may include constants that are utilized bythe service, and other unchanged data. Compared with the static portion,the dynamic portion may include data that may be changed during therunning of the service. Here, the dynamic portion may include variablesthat are utilized by the service, stacks of the function/procedure ofthe service and other data that may be changed during the running of theservice. The dynamic portion may change when the first group of requestsare accessing the service, and thus it should be copied after the firstgroup of requests have finished accessing the service.

FIG. 8A depicts a diagram 800A for migrating a static portion of aservice launched in a first container instance to a second containerinstance according to one implementation of the present disclosure. Inthis figure, the service 522 includes a static portion 820 and a dynamicportion 822. The requests 812 and 814 illustrated in shadow blocksindicate the requests in the first group. When the requests 812 and 814are accessing the service 522, the static portion 820 remains unchangedall the time and thus may be copied to the migrated service 524 to formthe static portion 830. However, as the requests 812 and 814 maypossibly modify the dynamic portion 822, the dynamic portion 822 shouldbe copied to the migrated service 524 after the requests 812 and 814have been finished.

FIG. 8B depicts a diagram 800B for migrating a dynamic portion of aservice launched in a first container instance to a second containerinstance according to one implementation of the present disclosure. InFIG. 8B, the requests 812 and 814 have been finished and a final versionof the dynamic portion 822 is formed. At this point, the dynamic portion822 may be copied to the migrated service 524 to form the dynamicportion 832. With the implementation, the service 522 may continueworking during most of the time duration when it is being migrated, andthe service 522 is shut down only in the time duration when the dynamicportion 822 is copied to the migrated service 524. Usually, the dynamicportion 832 is relatively small and only occupies a small part of thedata amount of the service 522, and thus copying the dynamic portion maybe performed instantly. Therefore, the shut down time of the service 522is greatly reduced.

In some implementations of the present disclosure, an accessconfiguration between a respective request in the second group ofrequests and the service may be determined; and then the second group ofrequests may be directed to the migrated service based on the accessconfiguration. In order to access a service launched in the containerinstance, the application should connect to the service via a specificconfiguration such as a predefined IP address and a port number.Accordingly, the IP address and port number should be recorded and usedfor directing the suspended requests in the second group to the migratedservice.

Referring to FIG. 8A, the access configuration related to the request816 may be collected. After both the static portion 820 and the dynamicportion 822 of the service 522 are migrated to form the migrated service524, the request 816 may be directed to the migrated service 524. Forexample, if the request 816 connects to the service 522 with theIP_address_1 and port_1, then the request 816 may connect to themigrated service 524 with the same IP_address_1 and port_1 after themigration.

The above paragraphs describe the service management by taking themethod 600 as an example. In order to implement the above method 600,multiple components may be added into the current container cluster 510.FIG. 9 depicts a diagram 900 of a container cluster for managing aservice according to one implementation of the present disclosure. Thecontainer cluster 510 may include a service agent 520 for obtaining afirst group of requests that are accessing a service launched in a firstcontainer instance and a second group of requests that are waiting foraccessing the service. In each of the container instance, there may bedeployed an instance agent for collecting information of the servicethat are launched and running in the container instance. For example, aninstance agent 914 is deployed in the container instance 514, and aninstance agent 912 may be deployed in the container instance 512.

A shared storage 930 may be deployed in the container cluster 510 forfacilitating in copying the to-be-migrated service. Further, a migrationcontroller 920 may be deployed for monitoring the state of the containerinstances and decide details of the migration. In one implementation,when the migration controller 920 determines that the workload of thecontainer instance 512 is above the threshold, the service launched inthe container instance 512 may be migrated to the container instance514. In another implementation, when the migration controller 920receives a migration command, the service may be migrated according tothe migration command.

In some implementations of the present disclosure, the data may bemirrored from the first container instance to the second containerinstance via a storage shared by the first and second containerinstances. Referring to FIG. 9, the shared storage 930 may be used as anintermediate storage for mirroring the data associated with the servicefrom the container instance 512 to the container instance 514.Continuing the above example of FIGS. 8A and 8B, first the staticportion 820 may be mirrored from the service 522 to the migrated service524; and then the dynamic portion 822 may be mirrored from the service522 to the migrated service 524. In another implementation, the dataassociated with the to-be-migrated service may be copied from onecontainer instance to another by other manners.

With the implementations of the present disclosure, as the service agentis deployed independent from the container instance, the service agentmay continuously maintain the information of the first and second groupsof requests even during the service migration. During the servicemigration, if a further request is issued by a further application foraccessing the service; then the received further request may be addedinto the second group of requests. At this point, from the perspectiveof the applications, the service launched in the container instance isalways available for being accessed, and the users of the applicationsmay not perceive the migration of the service.

FIG. 9 shows a procedure for managing the service, when the arrowsindicate the interactions between the components in the containercluster 510. As indicated by an arrow 940, the migration controller 920may query the service agent 520 for a first group of requests that areaccessing a service launched in a first container instance and a secondgroup of requests that are waiting for accessing the service. Then, themigration controller 920 may notify 942 the container instance 512 tomigrate the service to the container instance 514. Next, the containerinstance 512 may start to migrate the service by copying the dataassociated with the service via the shared storage 930 to the containerinstance 514. Specifically, first the data may be copied 944 from thecontainer instance 512 into the shared storage 930, and then the copieddata may be obtained 946 from the shared storage 930 to the containerinstance 514. At this point, the service migration may be completed.

It is to be understood that container cluster 510 in FIG. 9 is only anexample implementation of the present disclosure. Based on a specificenvironment of the implementation, the container cluster 510 may includemore or less components. For example, the functions of the service agent520 and migration controller 920 may be achieved by one singlecomponent, or the functions may be achieved by other components that aredeployed at another location. Alternatively, the data associated withthe service may be directed copied without the shared storage 930 as anintermediate storage.

In some implementations of the present disclosure, during the servicemigration, if the states of the requests change, the content of thefirst and second groups may be modified accordingly. Specifically, if agiven request in the second group of requests has started to access themigrated service in the second container instance, then it may beremoved from the second group of requests and added into a further firstgroup of requests. In this implementation, the requests in the first andsecond groups may be updated in real time according to the latest statesof the requests.

The above method may be implemented during the operation of thecontainer cluster 410. For example, the above method may be implementedagain after the service 522 is migrated from the container instance 512to the container instance 514 to generate the migrated service 524. Atthis point, the requests in the second group may start to access themigrated service 524, and thus a further first group may be generated torecord information about request that is accessing the migrated service524. If new requests are received and the new requests have to wait foraccessing the migrated service 524, the new requests may be added into afurther second group. Then, the above method may be implemented withrespect to the migrated service 524.

In some implementations of the present disclosure, the state of theservice may be recorded for example in the service agent 520. Theservice agent 520 may obtain the first and second groups of requests,where the obtained groups of requests may be utilized in case of aservice migration is triggered. If the service migration is nottriggered in the container cluster 510, the container cluster 510 maywork in a normal mode; else if the service migration is triggered, thenthe components in the contain cluster 510 may implement the method asdescribed in the present disclosure.

With the proposed implementations, once a service launched in thecontainer instance, this service is always available for being accessedfrom the perspective of the applications. Therefore, the disclosedimplementations may provide a method for migrating the service livelywith a reduced shut down time.

According to one implementation of the present disclosure, acomputer-implemented method is disclosed. According to the method, afirst group of requests that are accessing a service launched in a firstcontainer instance and a second group of requests that are waiting foraccess the service are obtained. A migrated service in a secondcontainer instance is generated by migrating the service from the firstcontainer instance to the second container instance based on theobtained first and second groups of requests. The second group ofrequests is directed to the migrated service in the second containerinstance.

According to one implementation of the present disclosure, a computingsystem is disclosed. The computing system comprises a computer processorcoupled to a computer-readable memory unit, where the memory unitcomprises instructions that when executed by the computer processorimplements a method. According to the method, a first group of requeststhat are accessing a service launched in a first container instance anda second group of requests that are waiting for access the service areobtained. A migrated service in a second container instance is generatedby migrating the service from the first container instance to the secondcontainer instance based on the obtained first and second groups ofrequests. The second group of requests is directed to the migratedservice in the second container instance.

According to one implementation of the present disclosure, a computerprogram product is disclosed. The computer program product is tangiblystored on a non-transient machine-readable medium and comprisingmachine-executable instructions. When the instructions are executed onan electronic device, the electronic device is caused to: obtain a firstgroup of requests that are accessing a service launched in a firstcontainer instance and a second group of requests that are waiting foraccessing the service; generate a migrated service in a second containerinstance by migrating the service from the first container instance tothe second container instance based on the obtained first and secondgroups of requests; and direct the second group of requests to themigrated service in the second container instance.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

What is claimed is:
 1. A method for migrating a service from one container to another container in a cloud environment, the method comprising: concurrently obtaining a first group of requests that are accessing a service launched in a first container instance and a second group of requests that are waiting for accessing the service; generating a migrated service in a second container instance by migrating the service from the first container instance to the second container instance based on the obtained first and second groups of requests, wherein the data associated with the migrated service is copied from the first container instance to the second container instance without suspending the first group of requests; and directing the second group of requests to the migrated service in the second container instance without a new request, wherein the migrated service remains active and the first group of requests accesses the migrated service during the service migration into the second container instance, wherein the migrated service includes one or more network activities and one or more computing activities, wherein the container cluster provides the migrated service without interruption to a consumer and without a change to one or more existing connections to the migrated service and at a reduced shut down time for the migrated service, wherein the migrated service is shut down for a dynamic portion to be copied to the migrated service, wherein the data associated with the migrated service is removed from the first container instance with the migrated service is completed.
 2. The method of claim 1, further comprising: suspending the second group of requests.
 3. The method of claim 2, wherein the copying data associated with the service, further comprises: copying a static portion of the data to the second container instance, the static portion storing data that is unchanged when the first group of requests are accessing the service; and copying a dynamic portion of the data to the second container instance, the dynamic portion storing data that is changed when the first group of requests are accessing the service in response to the first group of requests having completed accessing the service.
 4. The method of claim 2, wherein the copying data associated with the service, further comprises: mirroring the data from the first container instance to the second container instance via a storage shared by the first and second container instances.
 5. The method of claim 1, further comprising: receiving a further request that requests to access the service; and adding the received further request into the second group of requests.
 6. The method of claim 1, wherein obtaining the first and second groups of requests, further comprises: obtaining the first and second groups of requests in response to any of detecting a workload associated with the service being above a threshold, or receiving a migrating command.
 7. The method of claim 6, wherein detecting the workload associated with the service, further comprises: monitoring a workload of a resource in the first container instance in which the service is launched; and monitoring a workload of a resource occupied by the service in the first container instance.
 8. The method of claim 1, wherein obtaining the second group of requests, further comprises: determining an access configuration between a respective request in the second group of requests and the service; and directing the second group of requests, wherein directing the second group of requests to the migrated service based on the access configuration.
 9. The method of claim 8, further comprising: starting to access the migrated service in the second container instance in response to a given request in the second group of request; removing the given request from the second group of requests; and adding the given request into a further first group of requests.
 10. A computer system for migrating a service from one container to another container in a cloud environment, comprising: one or more processors, one or more computer-readable memories, one or more computer-readable tangible storage medium, and program instructions stored on at least one of the one or more tangible storage medium for execution by at least one of the one or more processors via at least one of the one or more memories, wherein the computer system is capable of performing a method comprising: concurrently obtaining a first group of requests that are accessing a service launched in a first container instance and a second group of requests that are waiting for accessing the service; generating a migrated service in a second container instance by migrating the service from the first container instance to the second container instance based on the obtained first and second groups of requests, wherein the data associated with the migrated service is copied from the first container instance to the second container instance without suspending the first group of requests; and directing the second group of requests to the migrated service in the second container instance without a new request, wherein the migrated service remains active and the first group of requests accesses the migrated service during the service migration into the second container instance, wherein the migrated service includes one or more network activities and one or more computing activities, wherein the container cluster provides the migrated service without interruption to a consumer and without a change to one or more existing connections to the migrated service and at a reduced shut down time for the migrated service, wherein the migrated service is shut down for a dynamic portion to be copied to the migrated service, wherein the data associated with the migrated service is removed from the first container instance with the migrated service is completed.
 11. The computer system of claim 10, further comprising: suspending the second group of requests.
 12. The computer system of claim 11, wherein the copying data associated with the service, further comprises: copying a static portion of the data to the second container instance, the static portion storing data that is unchanged when the first group of requests are accessing the service; and copying a dynamic portion of the data to the second container instance, the dynamic portion storing data that is changed when the first group of requests are accessing the service in response to the first group of requests having completed accessing the service.
 13. The computer system of claim 11, wherein the copying data associated with the service, further comprises: mirroring the data from the first container instance to the second container instance via a storage shared by the first and second container instances.
 14. The computer system of claim 10, further comprising: receiving a further request that requests to access the service; and adding the received further request into the second group of requests.
 15. The computer system of claim 10, wherein obtaining the first and second groups of requests, further comprises: obtaining the first and second groups of requests in response to any of detecting a workload associated with the service being above a threshold, or receiving a migrating command.
 16. The computer system of claim 15, wherein detecting the workload associated with the service, further comprises: monitoring a workload of a resource in the first container instance in which the service is launched; and monitoring a workload of a resource occupied by the service in the first container instance.
 17. The computer system of claim 10, wherein obtaining the second group of requests, further comprises: determining an access configuration between a respective request in the second group of requests and the service; and directing the second group of requests, wherein directing the second group of requests to the migrated service based on the access configuration.
 18. The computer system of claim 17, further comprising: starting to access the migrated service in the second container instance in response to a given request in the second group of requests; removing the given request from the second group of requests; and adding the given request into the first group of requests.
 19. A computer program product for migrating a service from one container to another container in a cloud environment, comprising: one or more computer-readable storage media and program instructions stored on at least one of the one or more tangible storage media, the program instructions executable by a processor to cause the processor to perform a method comprising: concurrently obtaining a first group of requests that are accessing a service launched in a first container instance and a second group of requests that are waiting for accessing the service; generating a migrated service in a second container instance by migrating the service from the first container instance to the second container instance based on the obtained first and second groups of requests, wherein the data associated with the migrated service is copied from the first container instance to the second container instance without suspending the first group of requests; and directing the second group of requests to the migrated service in the second container instance without a new request, wherein the migrated service remains active and the first group of requests accesses the migrated service during the service migration into the second container instance, wherein the migrated service includes one or more network activities and one or more computing activities, wherein the container cluster provides the migrated service without interruption to a consumer and without a change to one or more existing connections to the migrated service and at a reduced shut down time for the migrated service, wherein the migrated service is shut down for a dynamic portion to be copied to the migrated service, wherein the data associated with the migrated service is removed from the first container instance with the migrated service is completed.
 20. The computer program product of claim 19, further comprising: suspending the second group of requests. 